<template>
	<view class="">
		<div v-for="(item,i) in storeInfo.store_message" :key="i">
			<view class="title">
				{{item.store_name}}
			</view>
			<view class="">
				营业时间：{{item.opening_hours}}
			</view>
			<view class="">
				{{item.province}}-{{item.city}}-{{item.district}}
			</view>
			<view class="">
				{{item.opening_hours}}
			</view>
		</div>
		<!-- 团购商品 -->
		<h1>团购</h1>
		<div v-for="(item,i) in commodity" :key="i" class="flex">
			<view class="left ">
				<div style="width: 100rpx;height: 100rpx;background-color: pink;"></div>
				<!-- <image style="width: 100rpx;height: 100rpx;background-color: pink;" :src="item.avatar" mode=""></image> -->
			</view>
			<view class="right">
				{{item.price}}
			</view>
		</div>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				storeId: null,
				storeInfo: {},
				commodity: []
			}
		},
		methods: {
			getCommodity() {
				let result = {
					//this.storeId
					store_id: "OvzdaJZa74",
					code_name: "团购",
					dish_category: ""
				}
				this.http.post("/store_group_buying_or_variety_of_dishes_api", result).then(res => {
					this.commodity = res.result
					console.log(this.commodity, ':key="i"')
				})
			},
			getStoreInfo() {
				let result = {
					store_id: this.storeId,
				}
				this.http.post("/store_details_api", result).then(res => {
					this.storeInfo = res.result
					console.log(this.storeInfo)
				})
			},
			toDetails(store_id) {
				uni.navigateTo({
					url: `../../page_business/details?store_id=${store_id}`
				})
			}
		},
		onLoad(option) {
			this.storeId = option.store_id;
			this.getStoreInfo()
			this.getCommodity()
		},
	}
</script>

<style>
</style>